package cn.lblbc.stopwatch

import android.content.Context
import android.util.TypedValue
import androidx.annotation.AttrRes
import androidx.annotation.ColorInt

object ThemeHelper {
    @ColorInt
    fun getColorFromAttribute(context: Context, @AttrRes attribute: Int): Int {
        val typedValue = TypedValue()
        context.theme.resolveAttribute(attribute, typedValue, true)
        return typedValue.data
    }
}